﻿using AutoMapper;
using MyBlog.Model;
using MyBlog.WebApi.Dtos;
using System.DirectoryServices;

namespace MyBlog.WebApi.Utility.AutoMappers;

public class CustomerAutoMapperProfile : Profile
{
    public CustomerAutoMapperProfile()
    {
        base.CreateMap<WriterInfo, WriterInfoDto>();
        base.CreateMap<BlogNews, BlogNewsDto>()
            .ForMember(dest => dest.TypeName, source => source.MapFrom(src => src.TypeInfo.Name))
            .ForMember(dest => dest.WriterName, source => source.MapFrom(src => src.WriterInfo.Name));

    }
}
